home *** CD-ROM | disk | FTP | other *** search
/ Network CD 2 / Network CD - Volume 2.iso / programs / internet / tcp / amitcp / amitcp-src-22.lha / AmiTCP-2.2 / src / l / inet-handler / debug.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-11-17  |  1.3 KB  |  64 lines

  1. /*
  2.  * debug.h
  3.  *
  4.  * Author: Tomi Ollila <too@cs.hut.fi>
  5.  *
  6.  *     Copyright (c) 1993 Tomi Ollila
  7.  *         All rights reserved
  8.  *
  9.  * Created: Mon Nov 15 23:22:32 1993 too
  10.  * Last modified: Mon Nov 15 23:26:22 1993 too
  11.  *
  12.  * HISTORY
  13.  * $Log: debug.h,v $
  14.  * Revision 1.1  1993/11/17  11:47:44  too
  15.  * Initial revision
  16.  *
  17.  * Revision 1.1  1993/11/17  11:47:44  too
  18.  * Initial revision
  19.  *
  20.  */
  21.  
  22. #ifndef _DEBUG_H_
  23. #define _DEBUG_H_
  24.  
  25. #ifdef DEBUG
  26.  
  27. #define ReplyPkt(packet, res1, res2) do \
  28. { \
  29.     syslog(7, "ReplyPkt - " __FILE__ ":%ld: -- pkt: %lx res1: %ld res2: %ld\n", \
  30.        __LINE__, (LONG)packet, res1, res2); \
  31.     ReplyPkt(packet, res1, res2); \
  32. } while(0)
  33.  
  34. #define BP0 do { syslog(7, "** " __FILE__ ":%ld: **", __LINE__); \
  35.            Wait(SIGBREAKF_CTRL_E); \
  36.            } while (0)
  37.  
  38. #define DP0 syslog(7, "-- " __FILE__ ":%ld: --", __LINE__);
  39.  
  40. #define BP(fmt, args...) \
  41.   do { \
  42.      LONG _args[] = { __LINE__, args }; \
  43.          Syslog(7, "** " __FILE__ ":%ld: " fmt, (LONG *)_args); \
  44.      Wait(SIGBREAKF_CTRL_E); \
  45.      } while(0)
  46.  
  47. #define DP(fmt, args...) \
  48.   do { \
  49.      LONG _args[] = { __LINE__, args }; \
  50.          Syslog(7, "-- " __FILE__ ":%ld: " fmt, (LONG *)_args); \
  51.      } while(0)
  52.  
  53. #else /* not DEBUG */
  54.  
  55. #define BP0;
  56. #define BP (void)
  57. #define DP0;
  58. #define DP (void)
  59.  
  60. #endif /* DEBUG */
  61.  
  62. #endif /* _DEBUG_H_ */
  63.  
  64.